import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss' // global css
import App from './App'
import store from './store'
import router from './router'
import 'amfe-flexible'
import '@/icons' // icon
import '@/styles/reset.css'
import '@/styles/report_iconfont.css'
import dataV from '@jiaminghi/data-view'
import * as echarts from 'echarts'
import 'echarts-gl'
import axios from 'axios'
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
import { v_permission_directive } from '@/utils/v_permission'
// import 'viewerjs/dist/viewer.css'
// import Viewer from 'v-viewer'
// Vue.use(Viewer)
// // 配置项
// Viewer.setDefaults({
//   zIndexInline: 9999
// })

v_permission_directive(Vue)

Vue.config.productionTip = false;
Vue.prototype.$http = axios;
Vue.prototype.$echarts = echarts;
Vue.use(dataV);
Vue.use(ElementUI);

const token = window.localStorage.getItem('user_token')
const user_info = window.localStorage.getItem('user_info')
if (token && token !== 'undefined' && token !== 'null') {
  store.commit('user/setUserToken', JSON.parse(token))
}
if (user_info && user_info !== 'undefined' && user_info !== 'null') {
  store.commit('user/setUserInfo', JSON.parse(user_info))
}

Vue.config.productionTip = false
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
